package net.monare.mifss.admin.ui.comp;

import net.monare.mifss.MifssMessages;
import net.monare.mifss.admin.ui.win.ConfigureStorageWindow;
import net.monare.mifss.configurations.pojo.ContentPoolDef;
import net.monare.mifss.evn.ConfigureSelectedPoolListener;

import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.NativeButton;

public class PoolDefUiLink extends HorizontalLayout{

	private static final long serialVersionUID = -2073582801589355302L;
	
	public static final String TITLE_WIDTH = "220px";
	public static final String BUTTON_WIDTH = "80px";
	
	private Label poolTitleLabel;
	private NativeButton configurePool;
	
	
	public PoolDefUiLink(ContentPoolDef contentPoolDef, ConfigureStorageWindow parent) {

		poolTitleLabel = new Label(contentPoolDef.getTitle());
		poolTitleLabel.setWidth(TITLE_WIDTH);

		configurePool = new NativeButton(MifssMessages.getMessage("button.configure"));
		configurePool.setWidth(BUTTON_WIDTH);
		configurePool.addClickListener(new ConfigureSelectedPoolListener(parent, contentPoolDef));

		addComponent(poolTitleLabel);
		addComponent(configurePool);
		
	}
	
}
